package com.lhn.locks;

/**
 * 从字节码分析 synchronized 实现
 *
 * @author lhn
 * @date 2022/09/03 15:40
 * @since 1.0.0
 **/
public class LockByteCodeDemo {

    final Object object = new Object();

    public static void main(String[] args) {

    }

    public void m1() {
        synchronized (object) {
            System.out.println("------------ hello sync");
            throw new RuntimeException("123123");
        }

    }

    public synchronized void m2() {
        System.out.println("123");
    }

    public static synchronized void m3() {
        System.out.println("123");
    }
}